<?php
	require "../dao/course_dao.php";
	require "../dao/student_dao.php";
	
	session_start();
	$student = $_SESSION['student'];
	
	$courses = selectCouInformation();
?>
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<meta http-equiv="X-UA-Compatible" content="ie=edge" />
		<title><?=$student["sname"]?></title>
		<link rel="stylesheet" href="../css/register.css"/>
		<script src='../js/jquery-1.2.6.min.js'></script>
		<style>
			p{
				width:190px;
				height:30px;
				display: inline-block;
				margin:10px;
				text-align: center;
				font-weight: bold;
				box-shadow: 5px 5px 5px pink;
			}
			#sections{
				width:850px;
				height:350px;
				border:1px solid #000;
				margin:0 auto;
				overflow: auto;
			}
			input[type="checkbox"]{
				width:30px;
				height:30px;
				margin-right:10px;
			}
			ul{
				width:100%;
				height:100%;
				padding:5px;
			}
			li{
				list-style: none;
				display: inline-block;
				width:265px;
				height:50px;
				box-shadow: 1px 1px 1px #fff;
				vertical-align: middle;
				cursor: pointer;
			}
		</style>
	</head>
	<body>
		<div id="wrap">
			<form action="Stu_sections_server.php" method="POST" autocomplete="off">
				<input type="hidden" name="stu_secid"  value="<?=$student["stuid"]?>"/>
				<p><?=$student["snumber"]?></p>
				<p><?=$student["collegename"]?></p>
				<p><?=$student["gradename"]?></p>
				<p><?=$student["classname"]?></p>
				<span>课程选择</span>
				<div id="sections">
					<ul>
						<?php
							foreach($courses as $course){
								echo "
										<li>
											<input type='checkbox' name='sections[]' value='{$course["tid"]}'/>{$course["coursename"]}({$course["tname"]}老师)
										</li>
									";
							}	
						?>
					</ul>
				</div>
				
				<input type="reset" value="重   置" />
				<input type="submit" value="添   加"/>
			</form>
		</div>
	</body>
</html>